package com.example.jetpacktest.room

import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData

class StudentViewModel : AndroidViewModel {
    var db: AppDatabase? = null
    var list: LiveData<List<Student>>? = null

    constructor(application: Application):super(application){
        db = AppDatabase.getInstance(application)
        list = db?.studentDao()?.getStudents()
    }

    init {

    }

    fun getLiveDataStudent(): LiveData<List<Student>>? {
        return list
    }
}